home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / rexx / 1805 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: news-m01.ny.us.ibm.net!usenet
  2. From: trosky@ibm.net
  3. Newsgroups: comp.lang.rexx
  4. Subject: Re: VisPro/Rexx and Object Rexx
  5. Date: 3 Apr 1996 17:19:20 GMT
  6. Distribution: inet
  7. Message-ID: <4jubuo$3hoq@news-s01.ny.us.ibm.net>
  8. References: <4jjuo8$f6a@server-b.cs.interbusiness.it> <4jpgp1$ou4@ralph.vnet.net> <4jqfsg$hen@server-b.cs.interbusiness.it> <4jsagj$ahb@news1.mnsinc.com>
  9. Reply-To: trosky@ibm.net
  10. NNTP-Posting-Host: slip166-72-228-74.pa.us.ibm.net
  11. X-Newsreader: IBM NewsReader/2 v1.2.5
  12.  
  13. In <4jsagj$ahb@news1.mnsinc.com>, johnshoy@os2bbs.com writes:
  14. >I want to use the new Object Rexx for OS/2 with VisPro REXX.  In object rexx,
  15. >the directives and methods for your new classes are supposed to be the last
  16. >source code in your program.  In VisPro REXX, where would I put the class directives
  17. >and methods in order for them to be the last source code?  In the "when closed"
  18. >form for the main form in the project?  Or, is VisPro REXX always gong to 
  19. >have the last word by inserting code to clean up after itself after executing the
  20. >last user written code?
  21. >
  22. >Mike Johnshoy
  23. >johnshoy@os2bbs.com
  24.  
  25. Mike,
  26.  
  27. There are two ways to make VisPro REXX work with Object REXX:
  28.  
  29. 1.  Create a program, like "MakeMeths.CMD" which
  30.     makes all your public classes and methods.
  31.  
  32.     Then in your VisPro "When Opened" event for the
  33.     main form, simply include a statement
  34.  
  35.            call MakeMeths.CMD
  36.  
  37. 2.  Use our technique of creating classes and objects and
  38.     putting them in the global .environment.
  39.  
  40.     For instance, when you create a new class, make a program
  41.     like this and run it at startup.
  42.  
  43.        /* makestuff.CMD - make classes and store them in .environment */
  44.  
  45.        ::class myClass
  46.  
  47.          ::method INIT class
  48.            .environment['MYCLASS'] = self /* puts myClass in .environment*/
  49.            myObjDir = .directory~NEW
  50.            .environment['MYOBJDIR'] = myObjDir /* makes global directory
  51.                                                   for my objects */
  52.  
  53.  
  54.  
  55.          ::method INIT
  56.             use arg obj_id  /* some id/key for your objects */
  57.             .myObjDir[obj_id] = self  /* puts object in global directory */
  58.  
  59.  
  60.  
  61.          ::method myClassMeth class
  62.             ...
  63.  
  64.  
  65.  
  66.          ::method myInstMeth
  67.             ...
  68.  
  69.  
  70.  
  71.          In your VisPro REXX programs, you can simply use
  72.  
  73.  
  74.  
  75.                .myClass~myClassMeth
  76.  
  77.  
  78.  
  79.               .myObjDir[obj_id]~myInstMeth
  80.  
  81.          You don't have to do anything in VisPro to use these
  82.          They are in the environment.
  83.  
  84. We have examples of these in our book.
  85.  
  86. Hope this helps,
  87. Will Trosky
  88.